/*
 *  WeaponObject.h
 *  Rempart
 *
 *
 */

#ifndef __WEAPON_OBJECT
#define __WEAPON_OBJECT


#include <SFML/Graphics.hpp>
#include "MapElement.h"
#include "Index.h"
#include "Bullet.h"



extern sf::Mutex globalLock;


class WeaponObject : public MapElement, public sf::Thread {
protected:
	Index<Bullet*>* bulletList;
	sf::Clock* localClock;
	bool loop;
	bool enabled;
	void manageBullets() const;
	
	
public:
	WeaponObject();
	~WeaponObject();
	Bullet *getBulletAt(int i);
	void deleteBulletAt(int i);
	int getNumberOfBullets();
	void fire(const sf::Vector2<float>& target);
	void Run();
	void disable();
};

#endif